package com.snapp.web.actions.access;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.snapp.web.SNAppAccess;
import com.snapp.web.SNAppAction;

public class Logout extends SNAppAction {
	
	public String execute(HttpServletRequest req) {
		if (SNAppAccess.isValid(req)) {
			HttpSession sess = req.getSession();
			sess.invalidate();
			sess = null;
		} 
		setResults(RESULT_CODE_SUCCESS, "User logged out successfully");
		return super.execute(req);
	}
}
